from django.contrib import admin
from .models import Product, ProductImg, News


# Register your models here.
class ProductImgInline(admin.StackedInline):
    model = ProductImg
    extra = 1  # 默认显示条目的数量


# 定制整合产品和产品图片在一个页面管理
class ProductAdmin(admin.ModelAdmin):
    inlines = [ProductImgInline, ]


# 新闻进行注册
@admin.register(News)
class NewAdmin(admin.ModelAdmin):
    style_fields = {'content': 'ueditor'}


admin.site.register(Product, ProductAdmin)

admin.site.site_header='企业门户网站后台管理系统'
admin.site.site_title='企业门户网站后台管理系统'